﻿using System;
using System.Collections;
using System.Text;
using System.Text.RegularExpressions;
using System.Data;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DTcms.Common;

namespace DTcms.Web
{
    public partial class guanlian : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            BLL.users bll = new BLL.users();
            DataTable dt = bll.GetList(0, "company_id=0","id desc").Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                int _id = int.Parse(dr["id"].ToString());
                string _mobile = dr["mobile"].ToString();
                int _uid = new BLL.company().GetCoID(_mobile);
                if (_uid > 0)
                {
                    bll.UpdateField(_id, "company_id=" + _uid);
                    Response.Write(_mobile + "处理成功<br>");
                }
                else
                {
                    Response.Write(_mobile + "<br>");
                } 
            }
        }
    }
}